<!DOCTYPE html>
<html>
<head>
	<title>管理员列表</title>
	<#include "/header.html">
	<script src="${request.contextPath}/statics/js/modules/sys/generator.js"></script>
</head>
<body>
<div id="rrapp">
	<div class="grid-btn">
		<div class="form-group col-sm-2">
			<input type="text" class="form-control" v-model="q.tableName" @keyup.enter="query" placeholder="表名">
		</div>
		<a class="btn btn-default" @click="query">查询</a>
		<a class="btn btn-primary" @click="generator"><i class="fa fa-file-code-o"></i>&nbsp;生成代码</a>
	</div>
    <table id="jqGrid"></table>
    <div id="jqGridPager"></div>
</div>
</body>
<script>
	var vm = new Vue({
		el:'#rrapp',
		data:{
			q:{
				tableName: null
			}
		},
		methods: {
			query: function () {
				$("#jqGrid").jqGrid('setGridParam',{
					postData:{'tableName': vm.q.tableName},
					page:1
				}).trigger("reloadGrid");
			},
			generator: function() {
				var tableNames = getSelectedRows();
				if(tableNames == null){
					return ;
				}
				console.log(tableNames);
				location.href = baseURL+"sys/generator/code?tables=" + tableNames.join();
			},
			abc : function () {
				alert(111)
			}
		}
	});
</script>
</html>